Traditional relational database systems are classified, according to different loads to which they are oriented, into database systems used for on-line transaction processing (OLTP) and database systems used for on-line analytical processing (OLAP). A load to which a database system used for OLTP is oriented is called a transaction load, and a load to which a database system used for OLAP is oriented is called an analytical load. Correspondingly, the two different database systems manage data in databases in different manners. Specifically, because access types involved by the transaction load include data query and data modification (including data update, modification, insertion, deletion, and the like), the database system oriented to the transaction load should perform centralized control on related data to avoid distributing the data in different areas of a database and affecting data access efficiency. Access types involved by the analytical load are mainly read-only query requests, and each query request usually involves scanning, statistics, and analysis of a large amount of data. Therefore, the database system oriented to the analytical load should store data in different partitions, so that data access can be performed in parallel in multiple areas, thereby improving data access efficiency. A user needs to concurrently maintain the two database systems. However, with continuous increase of the data amount and system complexity, concurrent maintenance of the two systems increases burdens on the user. Therefore, a database system that can be oriented to mixed loads (that is, concurrently oriented to the transaction load and the analytical load) is developed in response to user requirements.
To ensure data access efficiency in the database system oriented to the mixed loads, data in the database needs to be partitioned according to features of both the transaction load and the analytical load. In the prior art, a data partitioning method in a database system is mainly performed by an on-line analytical processing system, for example, data partitioning is performed using a hash function according to hash values of one or several fields in a relational table of the database.
A data partitioning scheme obtained using the foregoing method facilitates processing of the analytical load, but this data partitioning scheme is unsatisfactory for the transaction load, and affects processing efficiency of the transaction load, thereby reducing working performance of the database system oriented to the mixed loads.